import random
from django.core.management.base import BaseCommand
from django.utils import timezone

from content_center.models import Content, Comment
from user_center.models import User


class Command(BaseCommand):
    def handle(self, *args, **options):
        contents = list(Content.objects.filter())
        comments = []
        user = User.objects.get(id=1)
        for i in range(10000):
            comments.append(Comment(user=user, content=random.choice(contents), text=random.choice([
                "纯打架",
                "中单真菜",
                "有勇无谋～",
                "惊喜。下路牛头玩的也好  ",
                "哈哈哈哈哈哈哈哈不愧是老六，从NBA偷到TNT",
                "真会玩 有意思",
                "离谱，别把鹈鹕老大位置给偷了",
                "全都在挖莱比锡的人",
                "也许我们球迷的眼光不专业，可是为什么图图要的人现在看下来除了格瓦好像都不太灵什么恩昆库啦保托啦，人家前段时间孔德不是要来，他好像也没啥意愿呀",
                "保托是我车制服组相中的人，媒体没把他和图赫尔联系在一起",
            ]), create_time=timezone.now(), update_time=timezone.now()))
        Comment.objects.bulk_create(comments)
